package com.zhuss.controller.repair;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.food.food.CreateFoodBo;
import com.zhuss.bean.bo.food.food.DeleteFoodBo;
import com.zhuss.bean.bo.food.food.DetailFoodBo;
import com.zhuss.bean.bo.food.food.StartFoodBo;
import com.zhuss.bean.bo.food.food.StopFoodBo;
import com.zhuss.bean.bo.food.food.UpdateFoodBo;
import com.zhuss.bean.bo.repair.repair.BackRepairBo;
import com.zhuss.bean.bo.repair.repair.CreateRepairBo;
import com.zhuss.bean.bo.repair.repair.DeleteRepairBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.exception.WpsException;
import com.zhuss.food.food.FoodOperateServiceExt;
import com.zhuss.repair.repair.RepairOperateServiceExt;


/**
 * 报修操作 controller
 * @Author hxx
   @Date 2020/03/02 16:01
 *
 */
  
 
@RestController
@RequestMapping("/repair")
public class RepairOperateController extends BaseController {
	

	@Autowired
	@Qualifier("repairOperateService")
	private OperateService<Void, Object> repairOperateService;
	
	@Autowired
	@Qualifier("repairOperateServiceExt")
	private RepairOperateServiceExt repairOperateServiceExt;
	
	
	/**
	 * 创建
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateRepairBo bo) throws WpsException {
		
		repairOperateService.create(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteRepairBo bo) throws WpsException {
		
		repairOperateService.delete(bo);
    }

	/**
	 * 撤回
	 * @param bo
	 * @throws WpsException
	 */
	@ResponseBody
    @PostMapping("/back")
    public void back(@RequestBody BackRepairBo bo) throws WpsException {
		
		repairOperateServiceExt.back(bo);
    }
	
	/**
	 * 修改
	 * @param bo
	 * @throws WpsException
	 */
	/*@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateFoodBo bo) throws WpsException {
		
		foodOperateService.update(bo);
    }*/
	
	/**
	 * 启用
	 * @param bo
	 * @throws WpsException
	 */
	/*@ResponseBody
    @PostMapping("/start")
    public void start(@RequestBody StartFoodBo bo) throws WpsException {
		
		foodOperateServiceExt.start(bo);
    }*/
	
	
	/**
	 * 停用
	 * @param bo
	 * @throws WpsException
	 */
	/*@ResponseBody
    @PostMapping("/stop")
    public void stop(@RequestBody StopFoodBo bo) throws WpsException {
		
		foodOperateServiceExt.stop(bo);
    }*/
	
}
